package ModelLayer;
import java.util.*;

/**
 * Write a description of class Lendings here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Lendings
{
    private long id;
    private Person person;
    private Copy copy;
    private String date;
    private String period;   
    private String status;
    static long runningLendingId = 1;
    
    /**
    * Constructor for objects of class Lendings
    */
    public Lendings(Person newPerson, Copy newCopy, String newDate, String newPeriod)
    {
        person = newPerson;
        copy = newCopy;
        id = runningLendingId++;
        date = newDate;
        period = newPeriod;        
        status = "lend";
    }
    
    /**
     * Accessor and mutator methods
     */
    public long getId()
    {
        return id;
    }
    
    public void setDate(String newDate)
    {        
        date = newDate;
    }
    
    public String getDate()
    {        
        return date;        
    }
    
    public void setPeriod(String newPeriod)
    {
        period = newPeriod;
    }
    
    public String getPeriod()
    {
        return period;
    }   
    
    public void setStatus(String newStatus)
    {
        status = newStatus;
    }
    
    public String getStatus()
    {
        return status;
    }
    
    public Copy getCopy()
    {
        return copy;
    }
    
    public void updateLending(String newDate, String newPeriod)
    {
        setDate(newDate);
        setPeriod(newPeriod);
    }    
}
